﻿<%@ Page Title="" Language="C#" MasterPageFile="~/SiteSearch.Master" AutoEventWireup="true" CodeBehind="CatCampoEstudio.aspx.cs" Inherits="CLab.PagAdminLab.CatCampoEstudio" %>
<%@ MasterType VirtualPath="~/SiteSearch.Master" %>


<asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" runat="server">
    <script type="text/javascript" src='<%=ResolveUrl("../Scripts/CatCampoEstudio.js") %>'></script>
  
</asp:Content>

<asp:Content ID="Content2" ContentPlaceHolderID="cphFilter" runat="server">
    <table>
        <tr>
            <td class="tdEtiqueta">
                Campo:
            </td>
              <td class="tdCampo">
                <ganda:TextBox ID="txtNombre" runat="server" Width="200px" MaxLength="200" TabIndex="0" />
            </td>
        </tr>
    </table>    
    <div class="btnBusar">
        <asp:UpdatePanel ID="UpdatePanel1" runat= "server">
            <ContentTemplate>
                <asp:Button ID="BtnBuscar" runat="server" Text="Buscar"  CssClass="boton" OnClick="btnBuscar_Click" />
            </ContentTemplate>
        </asp:UpdatePanel>
    </div>
</asp:Content>

<asp:Content ID="Content3" ContentPlaceHolderID="cphContent" runat="server">
    <div class="toolBarAcciones">
        <asp:Button ID="btnAgregar" runat="server" Text="Agregar" CssClass="boton" 
            onclick="btnAgregarr_Click"/>&nbsp;
        <asp:Button ID="btnExportar" runat="server" Text="Exportar" CssClass="boton" OnClick="btnExportar_Click" />
    </div>

    <br />
    <asp:UpdatePanel ID="UpdatePanel2" runat="server">
        <ContentTemplate>
            <ganda:GridView ID="gridCampos" runat="server" AutoGenerateColumns="False" AllowPaging="True" AllowScroll="true" OnPageIndexChanging="gridCampos_PageIndexChanging">
                <Columns>
                    <asp:BoundField DataField="IdLaboratorio" HeaderText="IdLaboratorio" SortExpression="IdLaboratorio" Visible="False"></asp:BoundField>
                    <asp:BoundField DataField="IdEstudio" HeaderText="IdEstudio" SortExpression="IdEstudio" Visible="False"></asp:BoundField>
                    <asp:BoundField DataField="IdCampo" HeaderText="Id" SortExpression="IdCampo" ItemStyle-Width="100px"></asp:BoundField>
                    <asp:BoundField DataField="NombreCampo" HeaderText="Descripción" SortExpression="NombreCampo" ItemStyle-Width="400px"></asp:BoundField>
                    <asp:BoundField DataField="IdTipoCampo" HeaderText="Tipo" SortExpression="IdTipoCampo" ItemStyle-Width="100px" Visible="false"></asp:BoundField>
                    <asp:BoundField DataField="NombreTipoCampo" HeaderText="Tipo Campo" SortExpression="NombreTipoCampo" ItemStyle-Width="100px"></asp:BoundField>
                    <asp:BoundField DataField="EsRequerido" HeaderText="EsRequerido" Visible="False" SortExpression="EsRequerido" ItemStyle-Width="100px"></asp:BoundField>
                    <asp:TemplateField HeaderText="Acción"  ItemStyle-HorizontalAlign="Center"  ItemStyle-Width="108px">
                        <ItemTemplate>                      
                            <asp:Button ID="BtnMod" CssClass="btnMod" runat="server" Text="" CommandName="cmdModificar" CommandArgument='<%#Eval("IdCampo") + "," + Container.DataItemIndex %>' />
                            <asp:Button ID="BtnDel" CssClass="btnDel" runat="server" Text="" CommandName="cmdEliminar" CommandArgument='<%#Eval("IdCampo") + "," + Container.DataItemIndex %>'  OnClientClick="return Elimina();" />
                        </ItemTemplate>
                        <ItemStyle Width="100px" />
                    </asp:TemplateField>
                 </Columns>
            </ganda:GridView>
        </ContentTemplate>
    </asp:UpdatePanel>

    <div style="display: none;">
        <asp:UpdatePanel runat="server" ID="updhidden">
            <ContentTemplate>
                <asp:HiddenField ID="hdnIdCampo" runat="server" />
                <asp:Button ID="btnElimina" runat="server" OnClick="btnElimina_Click" CausesValidation="false" />
            </ContentTemplate>
        </asp:UpdatePanel>
    </div>
    <script type="text/javascript">
        var hdnIdCampo = '<%=hdnIdCampo.ClientID %>'
        var btnElimina = '<%=btnElimina.ClientID %>'
        var btnAgregar = "<%=btnAgregar.ClientID %>";
        var btnExportar = '<%=btnExportar.ClientID %>'
        var btnBuscar = '<%=BtnBuscar.ClientID %>';
    </script>
</asp:Content>
